<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Stick Figure Adventure</title>

<script type="text/javascript">

var curScene=0;

function changeScene(decision) {
    // Clear the scene message
    var message = "";

    switch (curScene) {
    case 0:
      curScene = 1;
      message = "Your journey begins at a fork in the road.";
      break;
    case 1:
      if (decision == 1) {
        curScene = 2
        message = "You have arrived at a cute little house in the woods.";
      }
      else {
        curScene = 3;
        message = "You are standing on the bridge overlooking a peaceful stream.";
      }
      break;
    case 2:
      if (decision == 1) {
        curScene = 4
        message = "Peeking through the window, you see a witch inside the house.";
      }
      else {
        curScene = 5;
        message = "Sorry, a witch lives in the house and you just became part of her stew.";
      }
      break;
    case 3:
      if (decision == 1) {
        curScene = 6
        message = "Sorry, a troll lives on the other side of the bridge and you just became his lunch.";
      }
      else {
        curScene = 7;
        message = "Your stare is interrupted by the arrival of a huge troll.";
      }
      break;
    case 4:
      if (decision == 1) {
        curScene = 8
      }
      else {
        curScene = 5;
        message = "Sorry, you became part of the witch's stew.";
      }
      break;
    case 5:
      curScene = 0;
      break;
    case 6:
      curScene = 0;
      break;
    case 7:
      if (decision == 1) {
        curScene = 6
        message = "Sorry, you became the troll's tasty lunch.";
      }
      else {
        curScene = 9;
      }
      break;
    case 8:
      // TO BE CONTINUED
      break;
    case 9:
      // TO BE CONTINUED
      break;
    }

document.getElementById("sceneimg").src="../images/scene"+curScene+".png";
if(message!=""){
	alert(message);
	}
}
</script>
</head>
<body>
 	
 	<div style="margin-top:100px;text-align: center">
 		
 		<img id="sceneimg" src="../images/scene0.png" alt="Stick Figure Adventure"/><br>
 		please choose:
 		<input type="button" id="decision1" value="1" onclick="changeScene(1)"/>
 		<input type="button" id="decision2" value="2" onclick="changeScene(2)"/>
 	</div>
</body>
</html>